load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

proto_library(
    name = "changefeedpb_proto",
    srcs = ["scheduled_changefeed.proto"],
    strip_import_prefix = "/pkg",
    visibility = ["//visibility:public"],
)

go_proto_library(
    name = "changefeedpb_go_proto",
    compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_compiler"],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedpb",
    proto = ":changefeedpb_proto",
    visibility = ["//visibility:public"],
)

go_library(
    name = "changefeedpb",
    srcs = ["marshal.go"],
    embed = [":changefeedpb_go_proto"],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedpb",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/cloud",
        "//pkg/sql/parser",
        "//pkg/sql/sem/tree",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//jsonpb",
    ],
)
